package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ysd.Dao.Impl.MoHuDaoImpl;
import com.ysd.Dao.Impl.ProductDaoImpl;
import com.ysd.Dao.Impl.ProductSeriesDaoImpl;
import com.ysd.entity.Product;
import com.ysd.entity.ProductSeries;


public class MoHuServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String pname =request.getParameter("mohu");
		HttpSession session = request.getSession();
		session.setAttribute("pname", pname);
		MoHuDaoImpl mhDao = new MoHuDaoImpl();
		List<Product> mhList = mhDao.getMoHuList(pname); 
		request.setAttribute("mhList",mhList );//调用模糊查询实现类
		ProductSeriesDaoImpl psDao = new ProductSeriesDaoImpl();
		List<ProductSeries> ps = psDao.getProductSeriesList();//获取产品系列
		
		request.setAttribute("ps", ps);//调用产品列表实现类
		
	request.getRequestDispatcher("mohu.jsp").forward(request, response);
	}


}
